<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Write to stream</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.stream-truncate.html">streamWrapper::stream_truncate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.unlink.html">streamWrapper::unlink</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="streamwrapper.stream-write" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::stream_write</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.2, PHP 5)</p><p class="refpurpose"><span class="refname">streamWrapper::stream_write</span> &mdash; <span class="dc-title">Write to stream</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.stream-write-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><strong>streamWrapper::stream_write</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   )</div>

  <p class="para rdfs-comment">
   This method is called in response to <span class="function"><a href="function.fwrite.html" class="function">fwrite()</a></span>.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Remember to update the current position of the stream by number of bytes
    that were successfully written.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.stream-write-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">data</code></em></dt>

     <dd>

      <p class="para">
       Should be stored into the underlying stream.
      </p>
      <blockquote class="note"><p><strong class="note">Note</strong>: 
       <p class="para">
        If there is not enough room in the underlying stream, store as much as
        possible.
       </p>
      </p></blockquote>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.stream-write-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Should return the number of bytes that were successfully stored, or 0 if
   none could be stored.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-streamwrapper.stream-write-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">调用此方法失败将给出
<strong><code>E_WARNING</code></strong>（未实现）。</p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    If the return value is greater the length of
    <em><code class="parameter">data</code></em>, <strong><code>E_WARNING</code></strong> will be
    emitted and the return value will truncated to its length.
   </p>
  </p></blockquote>
 </div>

 



 <div class="refsect1 seealso" id="refsect1-streamwrapper.stream-write-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.fwrite.html" class="function" rel="rdfs-seeAlso">fwrite()</a> - 写入文件（可安全用于二进制文件）</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.stream-truncate.html">streamWrapper::stream_truncate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.unlink.html">streamWrapper::unlink</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
